import type { AxiosRequestConfig, AxiosResponse } from 'axios'

export interface HYRequestIntereptors<T = any> {
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig
  requestInterceptorCatch?: (error: any) => any
  responseInterceptor?: (
    res: AxiosResponse<T>
  ) => AxiosResponse<T> | Promise<AxiosResponse<T>>
  responseInterceptorCatch?: (error: any) => any
}
export interface HYRequestConfig<T = any> extends AxiosRequestConfig {
  interceptors?: HYRequestIntereptors<T>
  showLoading?: boolean
}
